<?php
/**
 * Created by PhpStorm.
 * Script Name: ComponentFastregisterweapp.php
 * Create: 2023/02/06 09:24
 * Description: 代理注册
 * link: https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/register-management/fast-registration-ent/registerMiniprogram.html
 * Author: fudaoji<fdj@kuryun.cn>
 */
namespace EasyOpen\Tencent\Request\Mp;

class ComponentFastregisterweapp
{
    private $url = "https://api.weixin.qq.com/cgi-bin/component/fastregisterweapp";
    private $getParams = array();
    private $postParams = array();
    private $action = 'create';
    private $legalPersonaWechat;
    private $legalPersonaName;
    private $code;
    private $name;
    private $codeType = 1;
    private $componentPhone= '';

    /**
     * 获取请求url
     * @author fudaoji<fdj@kuryun.cn>
     */
    public function getUrl(){
        return $this->url;
    }

    /**
     * 设置请求地址
     * @param string $url
     * @author fudaoji<fdj@kuryun.cn>
     */
    public function setUrl($url) {
        $this->url = $url;
    }

    /**
     * get请求参数
     * @author fudaoji<fdj@kuryun.cn>
     */
    public function getParams() {
        return $this->getParams;
    }

    /**
     * post请求参数
     * @author fudaoji<fdj@kuryun.cn>
     */
    public function postParams() {
        return $this->postParams;
    }

    /**
     * @return string
     */
    public function getAction(): string
    {
        return $this->action;
    }

    /**
     * @param string $action
     */
    public function setAction(string $action): void
    {
        $this->action = $action;
        $this->getParams['action'] = $action;
    }

    /**
     * @return mixed
     */
    public function getLegalPersonaWechat()
    {
        return $this->legalPersonaWechat;
    }

    /**
     * @param mixed $legalPersonaWechat
     */
    public function setLegalPersonaWechat($legalPersonaWechat): void
    {
        $this->legalPersonaWechat = $legalPersonaWechat;
        $this->postParams['legal_persona_wechat'] = $legalPersonaWechat;
    }

    /**
     * @return mixed
     */
    public function getLegalPersonaName()
    {
        return $this->legalPersonaName;
    }

    /**
     * @param mixed $legalPersonaName
     */
    public function setLegalPersonaName($legalPersonaName): void
    {
        $this->legalPersonaName = $legalPersonaName;
        $this->postParams['legal_persona_name'] = $legalPersonaName;
    }

    /**
     * @return mixed
     */
    public function getCode()
    {
        return $this->code;
    }

    /**
     * @param mixed $code
     */
    public function setCode($code): void
    {
        $this->code = $code;
        $this->postParams['code'] = $code;
    }

    /**
     * @return mixed
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * @param mixed $name
     */
    public function setName($name): void
    {
        $this->name = $name;
        $this->postParams['name'] = $name;
    }

    /**
     * @return int
     */
    public function getCodeType(): int
    {
        return $this->codeType;
    }

    /**
     * @param int $codeType
     */
    public function setCodeType(int $codeType): void
    {
        $this->codeType = $codeType;
        $this->postParams['code_type'] = $codeType;
    }

    /**
     * @return string
     */
    public function getComponentPhone(): string
    {
        return $this->componentPhone;
    }

    /**
     * @param string $componentPhone
     */
    public function setComponentPhone(string $componentPhone): void
    {
        $this->componentPhone = $componentPhone;
        $this->postParams['component_phone'] = $componentPhone;
    }
}